package com.mon4cc.simulation;

import com.mon4cc.cmon.model.event.IEvent;
import com.mon4cc.cmon.model.event.IEventAttrContext;
import com.mon4cc.simulation.application.Simulation;
import org.jbpt.pm.FlowNode;

import java.util.Map;
import java.util.Set;

/**
 * @author Ping
 * @date 2022/12/19 11:40
 **/
public interface ExecuteContext {
    public static final String NameOfCaseId = IEvent.ATTR_NAME_FOR_CASE_ID ;
    public Object get(String attr) ;
    public FlowNodeSimulatedInstance getSimulationInstance(FlowNode flowNode) ;
    public FlowNodeSimulatedInstance getNextEnabledInstance() ;
    public void updateDataContext(FlowNodeSimulatedInstance currentInstance) ;
    public void updateDataContext(Map<String, Object> dataValues) ;
    public void updateEnabledSimulatedInstance(FlowNodeSimulatedInstance currentInstance, Set<FlowNode> nextCandidateFlowNode) ;
    public void updateEnabledSimulatedInstance(FlowNodeSimulatedInstance currentInstance, FlowNode next)  ;
    public boolean endEventArrived() ;
    public boolean needToSwapped(FlowNodeSimulatedInstance currentInstance) ;
    public String getSwappedInstanceName(FlowNodeSimulatedInstance currentInstance) ;
    public boolean needToAddArtificalInstance(FlowNodeSimulatedInstance currentInstance) ;
    public boolean generatedEnoughEvents() ;
    public long getCaseId() ;
    public void setCaseId(long caseId) ;
    public Map<String, Object> currentDataContext() ;
    public void release() ;
    public void reset(Map<String,Object> initParams) ;
    public IEventAttrContext attrContext() ;
    public void increaseTotalNum() ;
    public Map<Long, Long> getTraceLengthForEachCase() ;
    public Map<Long, Long> getErrorMap() ;
    public void increaseErrorNum() ;
}
